import Vue from 'vue'
import Router from 'vue-router'

// 引入主布局和二级页面
import Login from '@/views/Login.vue'
import Auth from '@/views/Auth.vue'
import Review from '@/views/Review.vue'
import HelpPage from "@/views/HelpPage.vue";
import Layout from '@/views/AppLayout.vue'
import Dashboard from '@/views/DashboardPage.vue'
import ExpertList from '@/views/ExpertList'
import JudgeManagement from '@/views/JudgeManagement'
import JudgeRecommendation from '@/views/JudgeRecommendation'
import ReviewerRecommend from '@/views/ReviewerRecommend'
import ProjectReview from '@/views/ProjectReview'
import Statistics from '@/views/StatisticsPage.vue'
import ProjectList from '@/views/ProjectList'
import ProjectAllocation from '@/views/ProjectAllocation'
import ReviewActivitySetting from '@/views/ReviewActivitySetting'
import ReviewTimeSetting from '@/views/ReviewTimeSetting'
import SystemParameters from '@/views/SystemParameters'

Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [
        {path: '/login', name: 'Login', component: Login},
        {path: '/auth', name: 'Auth', component: Auth},
        {path: '/review', name: 'Review', component: Review},
        {path: '/help-page', name: 'HelpPage', component: HelpPage},
        {
            path: '/',
            component: Layout, // 主布局作为父组件
            redirect: '/dashboard', // 默认跳转到仪表盘
            children: [
                // 仪表盘
                {
                    path: 'dashboard',
                    name: 'Dashboard',
                    component: Dashboard,
                    meta: { title: '仪表盘', icon: 'fa-dashboard' }
                },
                // 专家列表
                {
                    path: 'expert-list',
                    name: 'ExpertList',
                    component: ExpertList,
                    meta: { title: '专家列表', icon: 'fa-users' }
                },
                // 评委管理-精简版
                {
                    path: 'judge-management',
                    name: 'JudgeManagement',
                    component: JudgeManagement,
                    meta: { title: '评委管理', icon: 'fa-random' }
                },
                // 评委推荐-原型版本
                {
                    path: 'judge-recommendation',
                    name: 'JudgeRecommendation',
                    component: JudgeRecommendation,
                    meta: { title: '评委推荐', icon: 'fa-random' }
                },
                // 评委推荐-包含“评审活动”的版本
                {
                    path: 'reviewer-recommend',
                    name: 'ReviewerRecommend',
                    component: ReviewerRecommend,
                    meta: { title: '评委推荐', icon: 'fa-random' }
                },
                // 项目列表
                {
                    path: 'project-list',
                    name: 'ProjectList',
                    component: ProjectList,
                    meta: { title: '项目列表', icon: 'fa-folder-open' }
                },
                // 项目分配
                {
                    path: 'project-allocation',
                    name: 'ProjectAllocation',
                    component: ProjectAllocation,
                    meta: { title: '项目分配', icon: 'fa-exchange' }
                },
                // 项目评审
                {
                    path: 'project-review',
                    name: 'ProjectReview',
                    component: ProjectReview,
                    meta: { title: '项目评审', icon: 'fa-pencil-square-o' }
                },
                // 统计分析
                {
                    path: 'statistics',
                    name: 'Statistics',
                    component: Statistics,
                    meta: { title: '统计分析', icon: 'fa-bar-chart' }
                },
                // 评审活动设置
                {
                    path: 'review-activity-setting',
                    name: 'ReviewActivitySetting',
                    component: ReviewActivitySetting,
                    meta: { title: '评审活动设置', icon: 'fa-clock-o' }
                },
                // 评审时间设置
                {
                    path: 'review-time-setting',
                    name: 'ReviewTimeSetting',
                    component: ReviewTimeSetting,
                    meta: { title: '评审时间设置', icon: 'fa-clock-o' }
                },
                // 系统参数
                {
                    path: 'system-parameters',
                    name: 'SystemParameters',
                    component: SystemParameters,
                    meta: { title: '系统参数', icon: 'fa-cog' }
                }
            ]
        },
    ]
})